import axios from 'axios'

const http = axios.create({
    timeout: 3000,
    // withCredentials: true,
    headers: {
        'Content-Type': 'application/json; charset=utf-8'
    }
})

http.interceptors.request.use(config => {
    config.headers['token'] = localStorage.token
    return config
}, error => {
    return Promise.reject(error)
})

http.interceptors.response.use(response => {
    return response
}, error => {
    return Promise.reject(error)
})


export default http;